package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.NursingProject;
import com.zzyl.nursing.service.INursingProjectService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 预约信息Controller
 *
 * @author JQ
 */
@RestController
@RequestMapping("/member/orders/project")
@Tag(name =  "预约信息相关接口")
public class MemberOrderController extends BaseController {
    @Autowired
    private INursingProjectService nursingProjectService;

    @GetMapping("/page")
    @Operation(summary = "分页查询护理项目列表")
    public TableDataInfo<NursingProject> page(Integer pageNum, Integer pageSize, String name, Integer status) {
        return nursingProjectService.pageByNameAndStatus(pageNum, pageSize, name, status);
    }

    @GetMapping("/{id}")
    @Operation(summary = "获取护理项目详细信息")
    public R<NursingProject> getInfo(@Param(value = "护理项目ID")
                                     @PathVariable Long id) {
        return R.ok(nursingProjectService.selectNursingProjectById(id));
    }
}